Optimal. Leaf size=65 \[ \frac{a \sin (c+d x)}{d^2}-\frac{a x \cos (c+d x)}{d}+\frac{2 b x \sin (c+d x)}{d^2}+\frac{2 b \cos (c+d x)}{d^3}-\frac{b x^2 \cos (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.10529, antiderivative size = 65, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 4, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.308, Rules used = {6742, 3296, 2637, 2638} \[ \frac{a \sin (c+d x)}{d^2}-\frac{a x \cos (c+d x)}{d}+\frac{2 b x \sin (c+d x)}{d^2}+\frac{2 b \cos (c+d x)}{d^3}-\frac{b x^2 \cos (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 6742
Rule 3296
Rule 2637
Rule 2638
Rubi steps
\begin{align*} \int x (a+b x) \sin (c+d x) \, dx &=\int \left (a x \sin (c+d x)+b x^2 \sin (c+d x)\right ) \, dx\\ &=a \int x \sin (c+d x) \, dx+b \int x^2 \sin (c+d x) \, dx\\ &=-\frac{a x \cos (c+d x)}{d}-\frac{b x^2 \cos (c+d x)}{d}+\frac{a \int \cos (c+d x) \, dx}{d}+\frac{(2 b) \int x \cos (c+d x) \, dx}{d}\\ &=-\frac{a x \cos (c+d x)}{d}-\frac{b x^2 \cos (c+d x)}{d}+\frac{a \sin (c+d x)}{d^2}+\frac{2 b x \sin (c+d x)}{d^2}-\frac{(2 b) \int \sin (c+d x) \, dx}{d^2}\\ &=\frac{2 b \cos (c+d x)}{d^3}-\frac{a x \cos (c+d x)}{d}-\frac{b x^2 \cos (c+d x)}{d}+\frac{a \sin (c+d x)}{d^2}+\frac{2 b x \sin (c+d x)}{d^2}\\ \end{align*}
Mathematica [A] time = 0.100959, size = 45, normalized size = 0.69 \[ \frac{d (a+2 b x) \sin (c+d x)-\left (a d^2 x+b \left (d^2 x^2-2\right )\right ) \cos (c+d x)}{d^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.004, size = 121, normalized size = 1.9 \begin{align*}{\frac{1}{{d}^{2}} \left ({\frac{b \left ( - \left ( dx+c \right ) ^{2}\cos \left ( dx+c \right ) +2\,\cos \left ( dx+c \right ) +2\, \left ( dx+c \right ) \sin \left ( dx+c \right ) \right ) }{d}}+a \left ( \sin \left ( dx+c \right ) - \left ( dx+c \right ) \cos \left ( dx+c \right ) \right ) -2\,{\frac{cb \left ( \sin \left ( dx+c \right ) - \left ( dx+c \right ) \cos \left ( dx+c \right ) \right ) }{d}}+ac\cos \left ( dx+c \right ) -{\frac{{c}^{2}b\cos \left ( dx+c \right ) }{d}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.01656, size = 158, normalized size = 2.43 \begin{align*} \frac{a c \cos \left (d x + c\right ) - \frac{b c^{2} \cos \left (d x + c\right )}{d} -{\left ({\left (d x + c\right )} \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right )} a + \frac{2 \,{\left ({\left (d x + c\right )} \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right )} b c}{d} - \frac{{\left ({\left ({\left (d x + c\right )}^{2} - 2\right )} \cos \left (d x + c\right ) - 2 \,{\left (d x + c\right )} \sin \left (d x + c\right )\right )} b}{d}}{d^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.61627, size = 108, normalized size = 1.66 \begin{align*} -\frac{{\left (b d^{2} x^{2} + a d^{2} x - 2 \, b\right )} \cos \left (d x + c\right ) -{\left (2 \, b d x + a d\right )} \sin \left (d x + c\right )}{d^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.603914, size = 82, normalized size = 1.26 \begin{align*} \begin{cases} - \frac{a x \cos{\left (c + d x \right )}}{d} + \frac{a \sin{\left (c + d x \right )}}{d^{2}} - \frac{b x^{2} \cos{\left (c + d x \right )}}{d} + \frac{2 b x \sin{\left (c + d x \right )}}{d^{2}} + \frac{2 b \cos{\left (c + d x \right )}}{d^{3}} & \text{for}\: d \neq 0 \\\left (\frac{a x^{2}}{2} + \frac{b x^{3}}{3}\right ) \sin{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.10656, size = 66, normalized size = 1.02 \begin{align*} -\frac{{\left (b d^{2} x^{2} + a d^{2} x - 2 \, b\right )} \cos \left (d x + c\right )}{d^{3}} + \frac{{\left (2 \, b d x + a d\right )} \sin \left (d x + c\right )}{d^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]